
// 不定义函数返回值的时候也能根据返回值推断出类型

// function info(name:string,age:number){
//     console.log(name,age);
//     return 3
// }

// info("wangwu",23)


// let info = function (name: string, age: number) {
//     console.log(name, age);
//     return 3
// }

// info("wangwu", 23)


// let info:(name:string,age:number) => number = 
// function(name,age){
//     console.log(name,age);
//     return 3
// }

// info('Wangwu',23)



// type TypeInfoFun = (name:string,age:number) => number

// let info:TypeInfoFun = 
// function(name,age){
//     console.log(name,age);
//     return 3
// }

// info('Wangwu',23)



// rest 参数

function info(name:string,age:number,...rest:any){
    console.log("name:",name,"age:",age,"rest:",rest);
    return rest
}

info('Wangwu',23,'111','beijing',23)

